home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 12⁄31⁄89 / 0266-Bug found in TScroll-Dec89 < prev    next >
Encoding:
Text File  |  1990-01-02  |  2.3 KB  |  72 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  LOOMIS       to PLUMMER1     COWSAR1
  2.  
  3. Item    1212293                         24-Dec-89        05:06
  4.  
  5. From:   MADA.EUROPE                     MacApp Dev Assoc Europe, E Carrasco
  6.  
  7. To:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Bug found in TScrollBar Class
  10.  
  11. Attn:  MacApp technical list
  12.        ⁄ MacApp.Tech$
  13.  
  14. From:  Father Vincent
  15.        Traditions Monastiques
  16.        France
  17.        ⁄ MADA.Europe
  18.  
  19. Sub:   Bug found in TScrollBar Class
  20.  
  21.  
  22. Hi all,
  23.     I have just found a bug in TScrollBar.IScrollBar Method. (File
  24. UMacApp.TControls.p in Libraries folder).
  25.  
  26.     The arguments itsVal, itsMin and itsMax are LongInt's and they are passed
  27. as actual arguments to ICtlMgr procedure. But unfortunately the corresponding
  28. formal arguments of ICtlMgr are Integers. When the value of these arguments
  29. is too large for an integer, a TRAPV exception happens. It is in particular
  30. the case when a view with large coordinates is used.
  31.  
  32.     Below is the Method with my correction. It works fine.
  33.  
  34.     I pass zero instead of the LongInt arguments for those parameters, since
  35. the Long values are set by SetLongValues a few lines below.
  36.  
  37. (************************************************************************)
  38.  
  39. PROCEDURE TScrollBar.IScrollBar(itsSuperView: TView; itsLocation, itsSize:
  40. VPoint; itsHSizeDet,
  41.                                 itsVSizeDet: SizeDeterminer; itsDirection:
  42. VHSelect; itsVal, itsMin,
  43.                                 itsMax: LONGINT);
  44.  
  45.     BEGIN
  46. {??? OLD VERSION ???}
  47. (*  ICtlMgr(itsSuperView, itsLocation, itsSize, itsHSizeDet, itsVSizeDet, '',
  48. itsVal, itsMin,
  49.             itsMax, scrollBarProc); *)
  50. {??? OLD VERSION ???}
  51.  
  52. {??? Patch Begin : Replace itsMax, itsVal and itsMin by Zero to avoid INTEGER
  53. overflows ???}
  54.     ICtlMgr(itsSuperView, itsLocation, itsSize, itsHSizeDet, itsVSizeDet, '',
  55. 0, 0,
  56.             0, scrollBarProc);
  57. {??? Patch End ???}
  58.  
  59.     fDirection := itsDirection;
  60.     SetLongValues(itsVal, itsMin, itsMax, kDontRedraw);
  61.     IF itsDirection = h THEN
  62.         fDefChoice := mHScrollBarHit
  63.     ELSE
  64.         fDefChoice := mVScrollBarHit;
  65.     END;
  66. (************************************************************************)
  67.  
  68.  
  69. (Bug report originally posted on CalvaCom, a French BBS. Eric
  70. We hope Father Vincent will join AppleLink ASAP)
  71.  
  72.